///////////////////////////////////////////////////////////
//  Vector2D.as
//  Actionscript 3.0 implementation of Class Vector2D
//  owner: http://www.imanit.com/
//  resource page: http://www.scuge.com/ 
//  For Game Architecture or Flash Team Management Consulting contact iman@imanit.com
//  This code is without warranty and is to be used at your own risk.
//  Created on:      06-Dec-2009 5:02:48 PM
//  Original author: iMAN
///////////////////////////////////////////////////////////

package org.gof.display
{
	/**
	 * basic 2D vector.
	 * @author iMAN
	 * @version 1.0
	 * @created 06-Dec-2009 5:02:48 PM
	 */
	public class Vector2D
	{
	    public var x: Number = 0;
	    public var y: Number = 0;

	    /**
	     * constructor
	     * 
	     * @param x
	     * @param y    y
	     */
	    public function Vector2D(x:Number = 0, y:Number = 0): void
	    {
	    	this.x = x;
	    	this.y = y;
	    }
		public function move(dx:Number, dy:Number):void
		{
			this.x += dx;
			this.y += dy;
		}

		public function setPosition(x:Number,y:Number):void
		{
			this.x = x;
			this.y = y;
		}
	    /**
	     * returns a string with all data contained in object.
	     */
	    public function toString(): String
	    {
	    	return ("<"+x+","+y+">");
	    }

	}//end Vector2D

}